import java.util.Scanner;

/**
 * Created with IDEA
 * author:ju bai
 * Date:2021/5/15
 * Time:10:14
 **/
public class Main2 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            int n = sc.nextInt();
            int m = sc.nextInt();
            System.out.println(med(n, m));
        }
    }

    /**
     * 每日一题 -走方格的方案数
     *
     * @param n 行
     * @param m 列
     * @return 从左上角到右下角的路径数
     */
    public static int med(int n, int m) {
        //n=1,m>=1||n>=1,m=1
        if (m == 1 || n == 1) {
            return n + m;
        }
        //n>1,m>1
        return med(n - 1, m) + med(n, m - 1);
    }
}
